A number of different statistical techniques have been developed for monitoring performance of a program run on a data processing system. One of the most prominent techniques is to monitor the time spent in executing respective functions of the program. One difficulty with this approach is that in many instances the granularity of the clock used in timing the functions is too large to provide an accurate picture of how processing time is distributed amongst the respective functions. Instruction counting is another statistical technique for monitoring performance of a program. Instruction counting techniques have generally been limited to monitoring the performance of user level programs (as opposed to system level programs), such as application programs. These techniques have not been applicable to monitoring the performance of operating system kernels. As a result of these limitations, statistical techniques have often not been useful to a programmer to help him enhance program performance.